Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #12959/76e04447 backport][8.3.x] Fix ANSI escape codes for colored output not handled correctly with pytest.fail(..., pytrace=False) #12990

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Nov 25, 2024

This is a backport of PR #12959 as merged into main (76e0444).

Closes #12849


Description:


  • Include documentation when adding new features.
  • Include new tests or update existing tests when applicable.
  • Allow maintainers to push and squash when merging my commits. Please uncheck this if you prefer to squash the commits yourself.
  • Add text like closes #XYZW to the PR description and/or commits (where XYZW is the issue number). See the github docs for more information.
  • Create a new changelog file in the changelog folder, with a name like <ISSUE NUMBER>.<TYPE>.rst. See changelog/README.rst for details.
  • Add yourself to AUTHORS in alphabetical order.

- When `ReprEntry.style == "value"` (happens when calling `pytest.fail(..., pytrace=False)`, the message should not be printed to terminal using `TerminalWriter._write_source` because then it'll try to highlight the message as source code
- The message should be printed to terminal directly using `TerminalWriter.line` or `TerminalWriter.write`, I went with the later for testing purposes #12959 (comment)

Closes #12849

(cherry picked from commit 76e0444)
@nicoddemus nicoddemus enabled auto-merge (squash) November 25, 2024 12:27
@nicoddemus nicoddemus merged commit 16cb87b into 8.3.x Nov 25, 2024
29 checks passed
@nicoddemus nicoddemus deleted the patchback/backports/8.3.x/76e044477010dcc0e31d4a736b7130e044a01a7e/pr-12959 branch November 25, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants